#pragma once

#ifdef _WIN32 
#include <windows.h> 
#endif

#include "../Entity.h"
#include "../../Terrain.h"

class dynamicEntity: public Entity
{
public:
	dynamicEntity(glm::vec3 _Pos, float _r, float _speed, std::string _Name,
			std::string _modelFName, ModelPool *_mPool, PathFinder *_pathfinder,
			Terrain::Terrain *ter);

	virtual ~dynamicEntity(void);
	virtual void move();
	virtual void draw(int shadertype);
	virtual void drawPath(std::list<glm::vec2> MVector);
	virtual void updateAnimation();
	virtual void control(float t); // check move vector

	bool isMooving();

protected:
	float speed;
	float basespeed;

	bool Moving;
	bool visible;

	// position of next point to move
	std::list<glm::vec2> MoveVector;
	std::list<glm::vec2> tempVector;
	//For holding last reserved to prevent killing nodes
	glm::vec2 lastReserved;
	bool resFlag; //terranin reservation flag
	bool newMove;
	bool NewTarget; //new target flag. Solves cross thread calling to set position. used in goTo func.
	int refPathCycles;
	glm::vec2 tar;
	// pointer to terrain
	Terrain::Terrain *ter;
};

